cmake_minimum_required(VERSION 3.20) # 需要 CMake 3.14 或更高版本
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(server_test)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# 设置输出目录
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
set(PROJECT_LIB_DIR ${CMAKE_SOURCE_DIR}/lib)

include_directories(include)


add_library(example_strategy SHARED src/strategy/strategy_example.cpp)
# 添加编译选项
target_compile_options(example_strategy PRIVATE -fPIC)
target_include_directories(example_strategy PRIVATE ${PROJECT_SOURCE_DIR}/include)


add_executable(server_test src/datacenter/datacenter.cpp)
add_executable(strategy_engine src/strategy_engine/strategy_engine.cpp)
target_link_libraries(strategy_engine example_strategy)

